Skip to content

Port bundled CPython and ordered CodeMode into Maple Agent - #897

Draft
AnthonyRonning wants to merge 4 commits into
masterfrom
feature/cpython-codemode-monorepo
Draft

Port bundled CPython and ordered CodeMode into Maple Agent#897
AnthonyRonning wants to merge 4 commits into
masterfrom
feature/cpython-codemode-monorepo

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Adds the normal permission-controlled python_code tool to Maple Agent under apps/maple-agent/: bundled CPython, persistent task namespaces, a continuous asyncio loop, Reset/lifecycle fencing, four retained worker slots, and up to 32 permitted Python calls executed in submission order. Other tools retain concurrency.

The three implementation commits from Maple GPUI Draft PR #69 retain their original provenance in this branch. The branch integrates master ad5a389d, preserving its registry SDK policy, upstream CUA pin, and Agent fixes. Goose remains at scheduler patch bf62027fd499ad3133af35db9f0f566de6a5cc4c, with no Goose version upgrade or migration of Maple's legacy approval router.

The finishing pass improves ordinary file workflows:

  • Documents a tested external wheel installation recipe that preserves the packaged interpreter, plus Stop's grace-period effects and importable-module requirements for spawned process pools.
  • Preserves filenames in filesystem errors, shows readable syntax locations, and removes leading worker traceback wrappers while retaining existing formatting bounds.
  • Combines adjacent queued writes with the same stream/execution identity. A 5,000-line loop previously omitted 21,953 of 23,890 bytes because tiny writes exhausted metadata capacity; the regression now retains all bytes. Frame, queue, control-order and background-retention limits remain unchanged.
  • Adds an optional offline synthetic-wheel smoke that checks retained imports, both process-pool APIs with imported functions, and an unchanged runtime tree/signature.

Python packaging and native/Nix coverage use root Agent CI. Current update discovery, managed debug identity, contributor security rules, and independent Research behavior are preserved. Agent publication remains inactive. PR #2 and the original Draft PR #69 are untouched.

Validation on macOS ARM64 at 15cf7cfa, using the pinned Nix Rust/Cargo/Clippy 1.98 environment and shared debug cache:

  • Full just ci: all four Clippy configurations, warning-denied workspace debug build, 786 workspace tests passed (three existing ignored cases), 30 headless tests, 24 worker tests passed plus one Windows-only skip, and seven packaging tests.
  • All ten native root nix flake check --no-update-lock-file checks passed. Locked Cargo metadata confirms one crates.io maple-sdk 3.6.2 and one local proxy, with no legacy SDK.
  • Four real CPython ordered integration cases passed with each Goose loop. These are isolated scheduler tests, not authenticated Maple approval/resume validation.
  • Debug app reports maple-gpui 0.1.0 (15cf7cfa). Packaged-worker smoke, offline Unicode-path relocation, and strict ad hoc signature verification after execution passed.
  • Offline external wheel installation, retained imports, and imported-module spawn pools passed against a disposable copy of that final app. All 1,843 app tree entries remained unchanged; strict signatures passed before and after.

GitHub Actions billing remains outside the delivery gate; checks were not polled or retried.

Authenticated GUI/ACP/live-model workflows, native Windows/Linux/Intel execution, the full installed Linux Nix closure, browser-download Gatekeeper behavior, and release signing remain unverified. Final-value repr failure behavior and runtime-unavailable wording remain deferred. This remains a Draft PR.

(cherry picked from commit 4bfeb7177d6103c174d332bcb0128f1f36aa3703)

Adapt Python packaging and worker CI to the monorepo component layout; preserve local SDK/proxy dependencies, managed app identity and inactive Agent publication.
(cherry picked from commit e087b1af4eb0e4f77c036b9fff2f7904a2e9c4f0)

Reapply under apps/maple-agent while preserving monorepo SDK integration, test portability fixes and Agent update routing.
(cherry picked from commit 1c0ade10bfcaa33e6a2f5cd88cbbb48eda45ea1c)

Retain the exact published Goose scheduler patch and source hash in the Agent component dependency graph.
Preserve current SDK and CUA pins alongside the ordered Goose patch. Document external wheel installs and native execution limits, improve bounded exception diagnostics, and coalesce adjacent queued output after reproducing tiny-write truncation. Validate with the component Nix just ci gate, root flake checks, dependency graph verification, and focused native regressions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant